import { createStore } from "vuex";
import createPersistedState from "vuex-persistedstate";
export default createStore({
  state: {
    // 定义一个登陆状态
    isFirstRouter: false,
    isCollapse: false,
  },
  getters: {},
  mutations: {
    // 改变登陆状态
    changeFirstRouter(state, value) {
      state.isFirstRouter = value;
    },
    // 折叠侧边栏
    changeisCollapse(state) {
      state.isCollapse = !state.isCollapse;
    },
  },
  actions: {},
  modules: {},
  plugins: [createPersistedState({
    paths:['isCollapse']//控制持久化 
  })],
});
